package com.beauty.dressing.module.community.holder;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.beauty.dressing.R;
import com.beauty.dressing.common.base.BaseRecyclerViewHolder;
import com.beauty.dressing.common.bean.TopicTitle;
import com.framework.common.view.roundview.RoundTextView;

/**
 * @author xutingz
 * @company 9zhitx.com
 */

public class TopicTopHolder extends BaseRecyclerViewHolder<TopicTitle> {
    private ViewGroup mDynamicLayout,mExpandLayout;
    private TextView mTitleTxt;
    private RoundTextView mRoundTxt;

    public TopicTopHolder(Context context, LayoutInflater inflater, ViewGroup viewGroup) {
        super(R.layout.topic_title_item, context, inflater, viewGroup);
    }

    @Override
    public void findView() {
        mDynamicLayout = (ViewGroup) itemView.findViewById(R.id.dynamic_layout);
        mExpandLayout = (ViewGroup) itemView.findViewById(R.id.expand_layout);
        mTitleTxt = (TextView) itemView.findViewById(R.id.title);
        mRoundTxt = (RoundTextView) itemView.findViewById(R.id.round_txt);
    }

    @Override
    public void bindData(final TopicTitle bean, int position) {
        mDynamicLayout.setVisibility(View.VISIBLE);
        mExpandLayout.setVisibility(View.GONE);

        registerItemClick(bean,position);
    }

    private void setTextColor(RoundTextView rTv, String label){
//        if (Constants.POST_INTERACT.equals(label)){
//            RoundViewDelegate delegate = rTv.getDelegate();
//            delegate.setBackgroundColor(Color.parseColor("#9120f4"));
//            rTv.setText("活动");
//            Drawable drawable = mContext.getResources().getDrawable(R.drawable.community_expand_active);
//            drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
//            rTv.setCompoundDrawables(drawable, null, null, null);
//        }
    }

    @Override
    public void onItemClick(TopicTitle bean, int position) {
    }
}
